const db=require("../lib/db")
function classifyArticleList(article_classify){
    return new Promise((resolve,reject)=>{
        let sql = "select * from content where article_classify ='"+article_classify+"'";
        db.quarySql(sql).then(data=>{
            console.log(data)
            if(data.length==0){
                resolve(404)
            }else{
                let arr2=[]
                arr.map(element=>{
                    arr2.push({
                        _id:element._id,
                        title:element.title,
                        content:element.content,
                        author:element.author,
                        authorId:element.authorid,
                        classify:element.classify
                    })
                })
                resolve(arr2)
            }
            
        })

    })


}
//导出
module.exports=classifyArticleList;